﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace FM.播音.Services
{
    public class 关机配置
    {
        public 关机配置()
        {
            关机时间 = new TimeSpan(2, 0, 0);
            关机命令 = @"shutdown.exe -s -t 30";
        }

        [XmlAttribute]
        public bool Is启用 { get; set; }

        [XmlIgnore]
        public TimeSpan 关机时间 { get; set; }

        [XmlAttribute]
        public string 关机时间s
        {
            get { return 关机时间.ToString(); }
            set
            {
                TimeSpan r;
                if (TimeSpan.TryParse(value, out r))
                {
                    关机时间 = r;
                }
            }
        }

        [XmlAttribute]
        public string 关机命令 { get; set; }
    }
}
